package com.ruoyi.depot.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 备货计划装箱清单表
 * @TableName walmart_stock_plan_packing_list
 */
@TableName(value = "walmart_stock_plan_packing_list")
@Data
public class WalmartStockPlanPackingList implements Serializable {

    /**
     * 主键ID，自增
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 备货计划ID（关联 `walmart_stock_plan` 表的 `stock_id`）
     */
    @TableField(value = "stock_id")
    private String stockId;

    /**
     * 纸箱编号（用于标识不同的装箱）
     */
    @TableField(value = "box_number")
    private String boxNumber;

    /**
     * SKU（库存单位编号）
     */
    @TableField(value = "sku")
    private String sku;

    /**
     * GTIN（walmart链接对应的gtin）
     */
    @TableField(value = "gtin")
    private String gtin;

    /**
     * 装箱数量（当前箱子中该 SKU 产品的数量）
     */
    @TableField(value = "quantity")
    private Integer quantity;

    /**
     * 纸箱尺寸（如 "40x50x60 cm"）
     */
    @TableField(value = "box_size")
    private String boxSize;

    /**
     * 纸箱重量（单位：kg）
     */
    @TableField(value = "box_weight")
    private String boxWeight;

    /**
     * 产品尺寸（如 "40x50x60 cm"）
     */
    @TableField(value = "product_size")
    private String productSize;

    /**
     * 产品重量（单位：kg）
     */
    @TableField(value = "product_weight")
    private String productWeight;

    /**
     * 预估运费（当前sku的运输费用）
     */
    @TableField(value = "freight")
    private BigDecimal freight;

    /**
     * 单个运费（当前sku的单个运输费用）
     */
    @TableField(value = "unit_freight")
    private BigDecimal unitFreight;

    /**
     * 记录创建时间（默认存储为 `CURRENT_TIMESTAMP`）
     */
    @TableField(value = "created_at")
    private Date createdAt;

    /**
     * 临时的计费指标
     */
    private transient BigDecimal tempProductLevelChargeableMetric;


    /**
     * 序列化ID（用于对象序列化）
     */
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WalmartStockPlanPackingList other = (WalmartStockPlanPackingList) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getBoxNumber() == null ? other.getBoxNumber() == null : this.getBoxNumber().equals(other.getBoxNumber()))
                && (this.getSku() == null ? other.getSku() == null : this.getSku().equals(other.getSku()))
                && (this.getQuantity() == null ? other.getQuantity() == null : this.getQuantity().equals(other.getQuantity()))
                && (this.getBoxSize() == null ? other.getBoxSize() == null : this.getBoxSize().equals(other.getBoxSize()))
                && (this.getBoxWeight() == null ? other.getBoxWeight() == null : this.getBoxWeight().equals(other.getBoxWeight()))
                && (this.getFreight() == null ? other.getFreight() == null : this.getFreight().equals(other.getFreight()))
                && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getBoxNumber() == null) ? 0 : getBoxNumber().hashCode());
        result = prime * result + ((getSku() == null) ? 0 : getSku().hashCode());
        result = prime * result + ((getQuantity() == null) ? 0 : getQuantity().hashCode());
        result = prime * result + ((getBoxSize() == null) ? 0 : getBoxSize().hashCode());
        result = prime * result + ((getBoxWeight() == null) ? 0 : getBoxWeight().hashCode());
        result = prime * result + ((getFreight() == null) ? 0 : getFreight().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", boxNumber=").append(boxNumber);
        sb.append(", sku=").append(sku);
        sb.append(", quantity=").append(quantity);
        sb.append(", boxSize=").append(boxSize);
        sb.append(", boxWeight=").append(boxWeight);
        sb.append(", freight=").append(freight);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
